﻿using System;

namespace Entity.Calculator
{
    public class Calculator : ICalculator
    {
        public decimal Add(decimal operandOne, decimal operandTwo)
        {
            return operandOne + operandTwo;
        }


        public decimal Subtract(decimal operandOne, decimal operandTwo)
        {
            return operandOne - operandTwo;
        }


        public decimal Multiply(decimal operandOne, decimal operandTwo)
        {
            return operandOne * operandTwo;
        }


        public decimal Divide(decimal operandOne, decimal operandTwo)
        {
            if (operandTwo == 0)
                throw new DivideByZeroException();
            return operandOne / operandTwo;
        }
    }
}
